package com.api.volunteer.model;

import com.api.volunteer.listener.BaseEntityListener;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.util.Date;

/**
 * @author 邹宇杰
 * @email 2901570623@qq.com
 * @date 2022/3/29 22:26
 */
@Data
//映射公有属性
@EntityListeners(value = {BaseEntityListener.class})
@MappedSuperclass
public class BaseEntity {
    /**
     * 创建时间
     */
    @Column(name = "CREATE_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public Date createDate = new Date();

    /**
     * 最后一次更新人id
     */
    @Column(name = "UPDATE_USER_ID")
    public String lastUpdateUserId;

    /**
     * 最后一次更新时间
     */
    @Column(name = "LAST_UPDATE_TIME")
    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    public Date lastUpdateDate = new Date();


}
